<template>
  <el-form-item label="ID">
    <el-input v-model="selectedOptions.name" disabled />
  </el-form-item>
  <el-form-item label="name">
    <el-input v-model="selectedWidget.name" disabled />
  </el-form-item>
  <el-form-item label="类型">
    <el-select v-model="selectedOptions.type" placeholder="Select">
      <el-option
        v-for="item in typeOptions"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      />
    </el-select>
  </el-form-item>
  <el-form-item label="绑定值">
    <el-input v-model="selectedOptions.modelValue" />
  </el-form-item>
  <el-form-item label="单行输入字段标签">
    <el-input v-model="selectedOptions.singleinputWidth" />
  </el-form-item>
  <el-form-item label="输入框宽度">
    <el-input v-model="selectedOptions.singleinputText" />
  </el-form-item>
  <el-form-item label="同原生 maxlength 属性">
    <el-input v-model="selectedOptions.maxlength" />
  </el-form-item>
  <el-form-item label="最小输入长度">
    <el-input v-model="selectedOptions.minlength" />
  </el-form-item>
  <el-form-item label="是否显示统计字数">
    <el-switch v-model="selectedOptions.showWordLimit" />
  </el-form-item>
  <el-form-item label="输入框占位文本">
    <el-input v-model="selectedOptions.placeholder" />
  </el-form-item>
  <el-form-item label="是否显示清除按钮">
    <el-switch v-model="selectedOptions.clearable" />
  </el-form-item>
  <el-form-item label="是否显示切换密码图标">
    <el-switch v-model="selectedOptions.showPassword" />
  </el-form-item>
  <el-form-item label="是否禁用">
    <el-switch v-model="selectedOptions.disabled" />
  </el-form-item>
  <el-form-item label="输入框尺寸">
    <el-select v-model="selectedOptions.size" placeholder="Select">
      <el-option
        v-for="item in sizeOptions"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      />
    </el-select>
  </el-form-item>
  <el-form-item label="是否只读">
    <el-switch v-model="selectedOptions.readonly" />
  </el-form-item>
  <el-form-item label="控制是否能被用户缩放">
    <el-select v-model="selectedOptions.resize" placeholder="Select">
      <el-option
        v-for="item in resizeOptions"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      />
    </el-select>
  </el-form-item>
  <el-form-item label="输入时是否触发表单的校验">
    <el-switch v-model="selectedOptions.validateEvent" />
  </el-form-item>
</template>

<script setup>
defineOptions({
  name: "singleinputAttribute",
  inheritAttrs: false,
});
let $props = defineProps({
  selectedWidget: {
    type: Object,
    required: true,
  },
  selectedOptions: {
    type: Object,
    required: true,
  },
});
let sizeOptions = [
  {
    value: "large",
    label: "large",
  },
  {
    value: "default",
    label: "default",
  },
  {
    value: "small",
    label: "small",
  },
];
let typeOptions = [
  {
    value: "text",
    label: "text",
  },
  {
    value: "password",
    label: "password",
  },
];
let resizeOptions = [
  {
    value: "none",
    label: "none",
  },
  {
    value: "both",
    label: "both",
  },
  {
    value: "horizontal",
    label: "horizontal",
  },
  {
    value: "vertical",
    label: "vertical",
  },
];
</script>

<style lang="scss" scoped></style>
